/////////////////////////////////////////////////
repo:    comment_subject
target:  comment_subject
branch:  6.x-2.x
tags:    6.x-2.x-dev
node:    b7170f9b80105170470da1c2362d6668d6dca63d
changes:
* TEMP [#1038484] new token [comment-parent-author]
/////////////////////////////////////////////////
=================================================
message: TEMP [#1038484] new token [comment-parent-author]
branch:  6.x-2.x
tags:    tip
node:    631a7311a0e0c605849260806be104fc5b4c4eab
=================================================
diff -r b7170f9b8010 -r 631a7311a0e0 comment_subject/comment_subject.token.inc
--- comment_subject.token.inc	Sun Apr 04 12:30:03 2010 -0500
+++ comment_subject.token.inc	Mon Feb 07 12:56:25 2011 -0500
@@ -10,6 +10,7 @@ function comment_subject_token_list($typ
 
     $tokens['comment'] = array(
       'comment-pid'                   => t('Comment\'s parent ID (just for parent being another comment, otherwise zero)'),
+      'comment-parent-author'         => t('Paren\'s author (just for parent being another comment, otherwise empty)'),
       'comment-parent-title'          => t('Paren\'s title (the parent might be the node or a another comment)'),
       'comment-parent-title-raw'      => t('Paren\'s title. WARNING - raw user input'),
       'comment-auto-numbering'        => t('Auto-numbering with respect to node\'s comments count.'),
@@ -33,10 +34,12 @@ function comment_subject_token_values($t
     if ($comment->pid) { 
       $parent = _comment_load($comment->pid);
       $parent_title = $parent->subject;
+      $parent_author = $parent->name;
     }
     else {
       $parent = node_load($comment->nid);
       $parent_title = $parent->title;
+      $parent_author = ''; // consider what to do when it is not replying to another comment
     }
     
     // [comment-parent-auto-numbering]
@@ -46,6 +49,7 @@ function comment_subject_token_values($t
     $comment_numbering = _comment_subject_get_numbering($comment->nid, $comment->cid);
     
     $tokens['comment-pid']                   = $comment->pid;
+    $tokens['comment-parent-author']         = check_plain($parent_author);
     $tokens['comment-parent-title']          = check_plain($parent_title);
     $tokens['comment-parent-title-raw']      = $parent_title;
     $tokens['comment-auto-numbering']        = $comment_numbering;
/////////////////////////////////////////////////
generated with: drudiff comment_subject comment_subject 6.x-2.x-dev 6.x-2.x 
/////////////////////////////////////////////////
